<?php
namespace Admin\Controller;
use Think\Controller;
class SearchController extends CommonController{
	public function index(){
		$keywords =  $_GET['keywords'];
		$where['title'] = array('like','%'.$keywords.'%');
		$where['del'] = 0;
		$data = M('article')->where($where)->select();
		foreach ($data as $key => $value) {
			$data[$key]['content'] = htmlspecialchars($value['content']);
		}
		$this->assign('type',$_SESSION['type']);
		$this->assign('data',$data);
		$this->display();
	}
	public function sum_serch(){
		$keywords =  $_GET['keywords'];
		$where['title'] = array('like','%'.$keywords.'%');
		$where['del'] = 0;
		$data = M('article')->where($where)->select();
		foreach ($data as $key => $value) {
			$data[$key]['content'] = htmlspecialchars($value['content']);
		}
		$this->assign('data',$data);
		$this->display();
	}
}